package com.atguigu.gmall.weball.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.feign.order.OrderFeignClient;
import com.atguigu.gmall.order.vo.OrderConfirmDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

/**
 * @author lfy
 * @Description
 * @create 2023-08-01 9:20
 */
@Controller
public class TradeController {


    @Autowired
    OrderFeignClient orderFeignClient;

    @GetMapping("/trade.html")
    public String trade(Model model){
        //远程调用订单服务，获取到订单确认页的所有数据

        Result<Map<String, Object>> result = orderFeignClient.confirmDataVoResult();


        model.addAllAttributes(result.getData());


        return "order/trade";
    }
}
